package bll

import (
	"context"
	"github.com/LyricTian/gin-admin/v7/internal/app/schema"
)

func (a *GroupVideo) GetGroupVideo(ctx context.Context, params schema.GroupVideoQueryParam) (*schema.VideoQueryResult, error) {
	list,err:=a.GroupVideoModel.GetGroupVideo(ctx,params)
	if err != nil {
		return nil,err
	}
	for _, data := range list.Data {
		data.Like,data.Favorite = a.LikeModel.GetLikeNum(ctx,data.ID,2)
		data.IsLike = a.LikeModel.IsLike(ctx,data.ID,2)
	}

	return list,nil

}